:root {
    --primary: #4a90e2;
    --background: #f8f9fa;
    --text: #212529;
    --border: #dee2e6;
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.action-bar {
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.path-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.path-display {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-execute {
    background: #28a745;
    color: white;
    min-width: 100px;
}

.btn-execute:hover {
    filter: brightness(1.1);
}

.file-list {
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.file-list ul {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    margin: 0;
    padding: 0;
}

.file-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    list-style: none;
    transition: transform 0.2s;
    break-inside: avoid;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.file-item .filename {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.file-item .meta {
    font-size: 0.9em;
    color: #6c757d;
}

.gallery {
    margin: 0;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.image-card[open] summary {
    background: var(--primary);
    color: white;
}

.image-card summary {
    padding: 1rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s;
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.loading {
    animation: pulse 1.5s infinite;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    padding-top: 60px;
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 80%;
    max-height: 80vh;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.data-panels {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    .data-panels {
        grid-template-columns: 1fr 1fr 2fr;
        gap: 1.5rem;
    }
}

.data-panel {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.data-panel h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-panel .icon {
    font-size: 1.4em;
}

.file-panel {
    min-width: 300px;
}

.image-panel {
    min-width: 0;
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.status-box {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid #e0e0e0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1.5rem;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.status-text {
    color: #424242;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.processing .action-bar .btn,
body.processing .path-display {
    opacity: 0.6;
    pointer-events: none;
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0;
}

.user-info {
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
}
